'use strict';

angular.module('com.lx.ngsl.history.controller',[])
.controller('historyController',['$scope','$http','$location','$alert','historyService',function($scope,$http,$location,$alert,historyService){
	$scope.editItem={};
	$scope.editItem.name='';
	$scope.editItem.title='';
	$scope.historyQuery=function(){
		$scope.query($scope.currentPage);
	}
	
	$scope.query=function(page){
		page = page ? (page-1) : 0;
		$http({
			method:"GET",
			url:"/ngsl/history/query",
			params:{"name":$scope.editItem.name,
				    "title":$scope.editItem.title,
				    "page":page,
				    "size":$scope.pagesize
				   }
		}).success(function(data,status){
			$scope.items=data.content;
		}).error(function(data,status){
			$alert.error({message:'查询失败'});
		})
	}
	$scope.query($scope.currentPage);
}])